import { request } from '@/utils/request';
import Api from '@/core/permission/modules/strative/adminiStrative';
import publicApi from '@/core/permission/modules/public/params';

/**
 * @description 通过id查询开业场所信息
 */
export function placeInfo(id: any) {
  return request({
    url: Api.placeInfo + `/${id}`,
    method: 'get',
  });
}

/**
 * @description 获取任务信息列表
 */
export function getStrativePageList(data: API.StrativePageList) {
  return request({
    url: Api.pageList,
    method: 'post',
    data,
  });
}

/**
 * @description 添加任务信息
 */
export function saveTask(data: API.SaveTaskPageResultItem) {
  return request(
    {
      url: Api.saveTask,
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * @description 修改任务信息
 */
export function updataTask(data: API.UpdataTaskPageResultItem) {
  return request(
    {
      url: Api.updataTask,
      method: 'put',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * @description 删除任务信息
 */
export function deleteTask(id: string) {
  return request({
    url: Api.deleteTask + `/${id}`,
    method: 'delete',
  });
}

/**
 * @description 任务信息详情
 */
export function taskInfo(id: any) {
  return request({
    url: Api.taskInfo + `/${id}`,
    method: 'get',
  });
}

/**
 * @description 处理任务信息
 */
export function processTask(data: API.ProcessTaskPageResultItem) {
  return request(
    {
      url: Api.processTask,
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * @description 审核人列表
 */
export function getReviewUserList() {
  return request({
    url: Api.reviewUserList,
    method: 'get',
  });
}

/**
 * @description 行政许可审批记录
 */
export function getApproveRecord(id: any) {
  return request({
    url: Api.approveRecord + `/${id}`,
    method: 'get',
  });
}

/**
 * @description 行政许可审批
 */
export function approveTask(data: API.ApproveTaskPageResultItem) {
  return request(
    {
      url: Api.approveTask,
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * @description 行政许可审批列表
 */
export function approveList(data: API.StrativePageList) {
  return request({
    url: Api.approveList,
    method: 'post',
    data,
  });
}

/**
 * @description 获取检查类型字典
 * @returns
 */
export function getCheckType() {
  return request(
    {
      url: publicApi.check_type,
      method: 'get',
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * @description 获取区域数据
 * @returns
 */
export function getAreaList() {
  return request(
    {
      url: publicApi.area,
      method: 'get',
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * @description 获取场所类型字典
 * @returns
 */
export function getPlaceType() {
  return request(
    {
      url: publicApi.place_type,
      method: 'get',
    },
    {
      isGetDataDirectly: false,
    },
  );
}
